<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
{insert name="module_cssjs" css="core.css" js="jquery.min.js;jquery.area.js"}
</head>
{literal}
<script type="text/javascript">
$(document).ready(function() {
$('[name="del"]').click(function() {
	var $this = this;
	var nodeId = $(this).parents('tr').attr('node-id');
	if(!nodeId) {
		alert('缺少参数');return ;
	}
	if(!confirm('您确定删除此景点吗？'))return ;
	
	var params = {'id': nodeId};
	$.post('/yunying/product/del.json', params, function(dt) {
		if(dt.status) {
			alert(dt.message);
		} else {
			$($this).parents('tr').remove();
		}
	}, 'json');
});

$('[name="status1"]').click(function() {
	var status = $(this).attr('status');
	var id = $(this).attr('id');
	var act = $(this).attr('act');
	if(!id) {
		alert('未知景点ID');return ;
	}
	var params = {status: status, id: id};
	if(act) params.act = act;
	$.post('/yunying/product/status.json', params, function(dt) {
		if(dt.status) {
			alert(dt.message);
		} else {
			alert('更改景点状态成功');
			window.location.href=window.location.href;
		}
	}, 'json');
});
})
</script>
{/literal}
<body>
<h3 class="label">
	<strong class="on"><span>所有订单</span></strong>
	<span class="refresh"><a href="">刷新</a></span>
</h3>
<div class="search">
	<form action="">
	<span>订单号： <input name="oid" value="{$oid}" /></span>
	<span>用户名： <input name="nickname" value="{$nickname}" /></span>
	<span><label>状态： <select name="status"><option value="">不限</option><option {if $status == 1}selected="selected"{/if} value="1">待支付</option><option {if $status == 2}selected="selected"{/if} value="2">待发货</option><option {if $status == 3}selected="selected"{/if} value="3">完成</option></select></label></span>
	<input value="搜索" type="submit" />
	</form>
</div>
<div class="table">
	<table class="TB-list">
		<tr class="TB-header">
			<td width="110">订单号</td>
			<td width="80">用户名</td>
			<td width="180">门票名称</td>
			<td width="180">景点名称</td>
			<td width="60">单价</td>
			<td width="60">数量</td>
			<td width="60">合计</td>
			<td width="120">时间</td>
			<td width="70">订单状态</td>
			<td width="">操作</td>
		</tr>
		{foreach item=item key=key from=$order.data name=list}
		<tr {if $smarty.foreach.list.index%2 == 0}class="even"{else}class="odd"{/if} node-id={$item.id}>
			<td>{$item.oid}</td>
			<td>{$item.user.nickname}</td>
			<td>{$item.ticket.name}</td>
			<td>{$item.product.name}</td>
			<td>{$item.price}</td>
			<td>{$item.num}</td>
			<td>{$item.num*$item.price}</td>
			<td>{$item.created_time}</td>
			<td>{if $item.status == 0}等待付款{elseif $item.status == 1}等待发货{elseif $item.status == 2}完成{else}未知{/if}</td>
			<td>
				[<a href="{$_conf.server}/deal/{$item.id}.html" target="_blank">查看</a>]
				{if $item.status != 2}[<a href="javascript:void(0);" name="send">发货</a>]{/if}
			</td>
		</tr>
		{/foreach}
	</table>
	<div>{insert name="module_page" query=$query size=$order.size num=$order.num page=$order.page}</div>
</div>
</body>
</html>